/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#ifndef __WOW_COMMON_H__
#define __WOW_COMMON_H__

#include "Ogre.h"

#define TEXTURE_TYPE_SKIN 0
#define TEXTURE_TYPE_FACE 1
#define TEXTURE_TYPE_FACIAL_HAIR 2
#define TEXTURE_TYPE_HAIR 3
#define TEXTURE_TYPE_UNDERWEAR 4

#define RACE_BLOOD_ELF 10

#define GENDER_MALE 0
#define GENDER_FEMALE 1

#define WOW_DBC_CHR_RACE_NAME_FIELD 12// v3.1
#define MAP_TILE_CACHE_SIZE 16
#define MAP_CHUNK_VERTICES 145 //9*9+8*8=81+64=145
#define CHUNKS_PER_TILE 16*16

#define TILE_SIZE (533.33333f)
#define CHUNK_SIZE ((TILE_SIZE) / 16.0f)//a tile is construct by 16*16 chunck
#define UNIT_SIZE (CHUNK_SIZE / 8.0f)//a chunk is formed by 8(9) vertices
#define ZERO_POINT (32.0f * (TILE_SIZE))//64*64 tile per world,the center is 32
#define MAX_TEXTURE_LAYERS 4

#define SKY_MULTIPLY 36.0f

#define MAP_RENDER_DISTANCE 998.0f
#define HIGH_RES_DISTANCE 384.0f
#define MODEL_RENDER_DISTANCE 384.0f
#define DOODAD_RENDER_DISTANCE 64.0f

#define MAX_NAME_LEN 256
#define MAX_CHARACTER_LAYERS 64// assume the maximun layers is 64

#define	REGION_FAC	2
#define	REGION_PX	(256*REGION_FAC)

//flip character code
inline void flipcc(char *fcc)
{
	char t;
	t=fcc[0];
	fcc[0]=fcc[3];
	fcc[3]=t;
	t=fcc[1];
	fcc[1]=fcc[2];
	fcc[2]=t;
}

namespace PQGameCore
{
	enum WowModelType
	{
		WOW_MODLE_TYPE_NORMAL,
		WOW_MODEL_TYPE_CHARACTER,
		WOW_MODLE_TYPE_WMO,
		WOW_MODLE_TYPE_NPC
	};

	enum CharGenderType
	{
		CHAR_GENDER_MALE=0,
		CHAR_GENDER_FEMALE=1,
	};

	enum CharRaceType
	{
		WOW_RACE_TROLL=6,
		WOW_RACE_TAUREN=8,
		WOW_RACE_GOBLIN=9,
		WOW_RACE_BLOODELF=10,
		WOW_RACE_DRANEI=11,
		WOW_RACE_NAGA=13,
		WOW_RACE_BROKEN=14,
		WOW_RACE_UNKNOWN,
	};

}
#endif
